<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .col-xs-3{margin-top:5px;}
        th{text-align: center;}
        .form-group{margin-left:20px;}
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{vertical-align: middle;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;商家管理 > 景区供应商 >产品列表</h1></div>
    <form action="" method="get" class="form-inline">
        <input type="hidden" name="id" value="{:I('id')}">
        <div class="form-group">
            <label for="" >供应商名称:</label>
            <input type="text" name="supplier_name" value="{$post.supplier_name}" class="form-input" placeholder="请输入运营商名称" />
        </div>
        <div class="form-group">
            <label for="" >编号:</label>
            <input type="text" name="product_sn" value="{$post.product_sn}" class="form-input" placeholder="商品编号" />
        </div>
        <div class="form-group">
            <label for="" >等级:</label>
            <select name="scenic_level" class="form-input" id="">
                <option value="">全部</option>
                <option value="1" <if condition="$post['scenic_level'] eq 1">selected</if>  >一A级景区</option>
                <option value="2" <if condition="$post['scenic_level'] eq 2">selected</if> >二A级景区</option>
                <option value="3" <if condition="$post['scenic_level'] eq 3">selected</if> >三A级景区</option>
                <option value="4" <if condition="$post['scenic_level'] eq 4">selected</if> >四A级景区</option>
                <option value="5" <if condition="$post['scenic_level'] eq 5">selected</if> >五A级景区</option>
            </select>
        </div>

        <div class="form-group">
            <label for="" >审核状态:</label>
            <select name="is_review" id="is_review" class="form-input">
                <option value="">全部</option>
                <option value="-1" <if condition="$post['is_review'] eq -1">selected</if>>待审核</option>
                <option value="1" <if condition="$post['is_review'] eq 1">selected</if>>已审核</option>
            </select>
        </div>

        <div class="form-group">
            <label for="" >操作人:</label>
            <input type="text" name="entry_id"  value="{$post.entry_id}" class="form-input" placeholder="请输入操作人" />
        </div>
        <div class="form-group">
            <button class="btn btn-primary btn-sm">查询</button>
        </div>



        <div class="col-xs-12"  style="margin-top:10px;">
            <if condition="checkAuth('Dealer/Shops/addScenic')">
                <a href="{:U('addScenic',array('supplier_id'=>$post['id']))}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">添加产品</a>
            </if>
            <if condition="checkAuth('Dealer/Shops/scenicExportExcelBySupplierId')">
                <a href="{:U('scenicExportExcelBySupplierId',array('supplier_id'=>$post['id']))}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">导出</a>
            </if>
        </div>

    </form>

    <table class="table table-striped table-bordered table-hover table-condensed text-center">
        <thead>
        <tr>
            <th class="filtrate_1" >景区名称 <!--<input type="checkbox" class="checkAll">--></th>
            <th class="filtrate_2" >等级</th>
            <th class="filtrate_3" >编号</th>

         <!--   <th class="filtrate_4" >外币本价</th>
            <th class="filtrate_4" >汇率</th>-->
            <th class="filtrate_4" >人民币({$currency[$unit_supplier_info['currency_id']]})</th>
            <th class="filtrate_7" >操作人</th>
            <th class="filtrate_7" >审核状态</th>
            <th class="filtrate_7" >是否上架</th>
            <th class="filtrate_7"  style="width:180px;">操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
            <tr >
                <td class="filtrate_1" >{$vo.scenic_name} <!--<input type="checkbox" class="chk">--></td>
                <td class="filtrate_2">{$vo.scenic_level}A级景区</td>
                <td class="filtrate_3">{$vo.product_sn}</td>

              <!--  <td class="filtrate_4">
                    <p>成人:{$vo.adult_foreign_cost}元/人</p>
                    <p>儿童:{$vo.child_foreign_cost}元/人</p>
                </td>
                <td>
                    {$vo.exchange_rate}
                </td>-->
                <td>
                    <p>成人:{$vo.adult_actual_cost}/人</p>
                    <p>儿童:{$vo.child_actual_cost}/人</p>
                </td>
                <td class="filtrate_5">{$vo.sp_name}</td>
                <td class="filtrate_6">
                    <switch name="vo.is_review">
                        <case value="1">已审核</case>
                        <case value="-1">待审核</case>
                        <case value="-2">被拒</case>
                    </switch>
                </td>
                <td class="filtrate_7">
                    <switch name="vo.is_shelves">
                        <case value="1">上架</case>
                        <case value="-1">下架</case>
                    </switch>
                </td>
                <td class="filtrate_7">
                    <if condition="checkAuth('Dealer/Shops/editScenic')">
                        <if condition="$vo['is_review'] eq 1">
                            <a href="{:U('editScenic',array('scenic_priceId'=>$vo['scenic_priceId'],'supplier_id'=>$post['id']))}" class="btn btn-xs btn-warning">审核</a>
                            <else/>
                            <a href="{:U('editScenic',array('scenic_priceId'=>$vo['scenic_priceId'],'supplier_id'=>$post['id']))}" class="btn btn-xs btn-primary">审核</a>
                        </if>
                    </if>

                    <if condition="checkAuth('Dealer/Shops/scenicShelvesById')">
                        <if condition="$vo['is_shelves'] eq 1">
                            <a href="{:U('scenicShelvesById',array('scenic_priceId'=>$vo['scenic_priceId'],'is_shelves'=>-1))}" class="btn btn-xs btn-warning">下架</a>
                            <else/>
                            <a href="{:U('scenicShelvesById',array('scenic_priceId'=>$vo['scenic_priceId'],'is_shelves'=>1))}" class="btn btn-xs btn-primary">上架</a>
                        </if>
                    </if>


                </td>
            </tr>
        </volist>
        <tr>
            <td colspan="11">
                <!--分页样式-->
                <ul class="pagination">
                    {$show}
                </ul>
            </td>
        </tr>
        </tbody>
    </table>

</block>
<block name="js">
    <script src=""></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>
        /**
         * 打开订单详情页面
         * @param  {[int]}    orderId     [订单id]
         */

//筛选显示
        $('body').on('change','.filtrate',function () {
            var id=$(this).val();
            if($(this).is(':checked')){
                $('.filtrate_'+id).show();
            }else{
                $('.filtrate_'+id).hide();
            }
        });


        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#end_time'
            });
            laydate.render({
                elem: '#start_time'
            });
        })

        /**
         *订单详情
         * @param orderId
         */

        function openDetail(orderId){
            layer.open({
                type: 2,
                offset:20,
                area: ['90%','90%'],
                title: '订单详情',
                content: '{:U("Orders/detail")}',
            })
        }
    </script>
</block>
